<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/7/23
 * Time: 14:52
 */
namespace app\jujin\controller;

use app\admin\service\SystemCateService;
use controller\JunjinAdmin;
use think\Db;
use think\view\driver\Think;

class Recruitworkergrabsheet extends JunjinAdmin
{
    public $table='recruit_worker_grab_sheet';

    public function index()
    {
        $this->title = '找人抢单列表';
        $get = $this->request->get();
        $db = Db::name($this->table);
        if (isset($get['order_sn']) && $get['order_sn'] !== '') {
            $db->whereLike('order_sn', $get['order_sn']);
        }
        return parent::_list($db->order('id desc'));
    }
    /*protected function _form_filter(&$data)
    {
        if($this->request->isGet()){
            if($this->request->get('id')){
                $this->title='编辑找人信息';
            }else{
                $this->title='添加找人信息';
            }
            //查询生活分类
            $this->assign('lifes',Db::name('my_cate')
                ->where('pid',156)
                ->where('status',1)
                ->field('id,title')
                ->select()
            );
            //查询支付方式分类
            $this->assign('paytypes',Db::name('my_cate')
                ->where('pid',162)
                ->where('status',1)
                ->field('id,title')
                ->select()
            );
            //查询工种
            $this->assign('workerCates',Db::name('my_cate')
                ->where('pid',33)
                ->where('status',1)
                ->field('id,title')
                ->select()
            );
            $data['worker_info']=json_decode($data['worker_info'],true);
        }else{
            $data['grab_sheet_end_time']=strtotime($data['grab_sheet_end_time']);
            $data['start_time']=strtotime($data['start_time']);
            $data['end_time']=strtotime($data['end_time']);
            foreach ($data['wi_type'] as $k=>$v){
                $worker_info[$k]['type']=$v;
                $worker_info[$k]['number']=$data['wi_number'][$k];
                $worker_info[$k]['price']=$data['wi_price'][$k];
            }
            $data['worker_info']=json_encode($worker_info);
            $data['life_ids']=implode(',',$data['life_ids']);
        }
    }*/

}